package client;

/**
 * Client-side proxy for an Account.  Allows users to gain access to information 
 * about an account.  Basically a wrapper around a username.
 * It points at the RealSubject, Account. 
 */
public class AccountProxy 
{
	/** Creates an AccountProxy for the given account */
	public AccountProxy(String username) {
		this.username = username;
	}
	
	/**
	 * Creates a new AccountProxy to interface with the server-side Account
	 * via the DedicatedServer. The resulting AccountProxy will have read-only
	 * restrictions on the Account it stands for.
	 * @param username the user's account handle
	 * @return an AccountProxy for the given username
	 */
	public static AccountProxy getAccount(String username) {
		return new AccountProxy(username);
	}

	/**
	 * Returns the username associated with this account.
	 */
	public String getUserName() {
		return username;
	}

	private final String username;	
}
